/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package integracion;

import dao.FactoryDao;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import modelo.Paciente;

/**
 *
 * @author Miguel
 */
@WebService(serviceName = "servicioweb")
public class servicioweb {

    /**
     * This is a sample web service operation
     */
    @WebMethod(operationName = "hello")
    public String hello(@WebParam(name = "name") String txt) {
        Paciente p=null;
        FactoryDao dao=FactoryDao.getFactoryDao(FactoryDao.POSTGRES_FACTORY);
        p=dao.getusuarioDao().consultarpaciente(txt);
        if(p==null)
        {
            return "El paciente "+txt+" no existe ";
        }
        else {
            return p.toString();
            
        }
    }
}
